/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.uniminuto.edu.gimnasioInteligente.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author diegoalejandro
 */
@Entity
@Table(name = "historico_maquina")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HistoricoMaquina.findAll", query = "SELECT h FROM HistoricoMaquina h"),
    @NamedQuery(name = "HistoricoMaquina.findByIdHistoricoMaquina", query = "SELECT h FROM HistoricoMaquina h WHERE h.idHistoricoMaquina = :idHistoricoMaquina"),
    @NamedQuery(name = "HistoricoMaquina.findByTiempo", query = "SELECT h FROM HistoricoMaquina h WHERE h.tiempo = :tiempo"),
    @NamedQuery(name = "HistoricoMaquina.findByVelocidad", query = "SELECT h FROM HistoricoMaquina h WHERE h.velocidad = :velocidad"),
    @NamedQuery(name = "HistoricoMaquina.findByRitmoCardiaco", query = "SELECT h FROM HistoricoMaquina h WHERE h.ritmoCardiaco = :ritmoCardiaco"),
    @NamedQuery(name = "HistoricoMaquina.findByCalorias", query = "SELECT h FROM HistoricoMaquina h WHERE h.calorias = :calorias"),
    @NamedQuery(name = "HistoricoMaquina.findByFecha", query = "SELECT h FROM HistoricoMaquina h WHERE h.fecha = :fecha")})
public class HistoricoMaquina implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idHistorico_Maquina")
    private Integer idHistoricoMaquina;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "tiempo")
    private Double tiempo;
    @Column(name = "velocidad")
    private Double velocidad;
    @Column(name = "ritmoCardiaco")
    private Double ritmoCardiaco;
    @Column(name = "calorias")
    private Double calorias;
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @JoinColumn(name = "Maquina_idMaquina", referencedColumnName = "idMaquina")
    @ManyToOne(optional = false)
    private Maquina maquinaidMaquina;

    public HistoricoMaquina() {
    }

    public HistoricoMaquina(Integer idHistoricoMaquina) {
        this.idHistoricoMaquina = idHistoricoMaquina;
    }

    public Integer getIdHistoricoMaquina() {
        return idHistoricoMaquina;
    }

    public void setIdHistoricoMaquina(Integer idHistoricoMaquina) {
        this.idHistoricoMaquina = idHistoricoMaquina;
    }

    public Double getTiempo() {
        return tiempo;
    }

    public void setTiempo(Double tiempo) {
        this.tiempo = tiempo;
    }

    public Double getVelocidad() {
        return velocidad;
    }

    public void setVelocidad(Double velocidad) {
        this.velocidad = velocidad;
    }

    public Double getRitmoCardiaco() {
        return ritmoCardiaco;
    }

    public void setRitmoCardiaco(Double ritmoCardiaco) {
        this.ritmoCardiaco = ritmoCardiaco;
    }

    public Double getCalorias() {
        return calorias;
    }

    public void setCalorias(Double calorias) {
        this.calorias = calorias;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Maquina getMaquinaidMaquina() {
        return maquinaidMaquina;
    }

    public void setMaquinaidMaquina(Maquina maquinaidMaquina) {
        this.maquinaidMaquina = maquinaidMaquina;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idHistoricoMaquina != null ? idHistoricoMaquina.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistoricoMaquina)) {
            return false;
        }
        HistoricoMaquina other = (HistoricoMaquina) object;
        if ((this.idHistoricoMaquina == null && other.idHistoricoMaquina != null) || (this.idHistoricoMaquina != null && !this.idHistoricoMaquina.equals(other.idHistoricoMaquina))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.uniminuto.edu.gimnasioInteligente.entities.HistoricoMaquina[ idHistoricoMaquina=" + idHistoricoMaquina + " ]";
    }
    
}
